package com.aaa.user.service;

import com.aaa.user.dao.IntegrationDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * fileName:IntegrationServiceImpl
 * description:
 * author:lk
 * createTime:2020/1/10 14:08
 * version:1.0.0
 */
@Service
public class IntegrationServiceImpl implements IntegrationService{

    @Autowired
    private IntegrationDao integrationDao;


    @Override
    public List<Map> getIntegrationByMemberId(Long memberId) {

        List<Map> integrationList = integrationDao.getIntegrationByMemberId(memberId);
        for (Map map : integrationList) {
            Date date = (Date) map.get("create_time");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
            String create_time = sdf.format(date);
            map.put("create_time",create_time);
        }
        return integrationList;
    }
}
